package lambda;

public class test {
    public static void main(String[] args) {
        IStudent s=new IStudentImpl();
        s.add(new Student());

        IStudent s2=new IStudent() {
            @Override
            public int add(Student student) {
                System.out.println("匿名实现类中的add方法被执行了");
                return 0;
            }
        };
        s2.add(new Student());

        IStudent s3=(a) ->{
            System.out.println(a);
            System.out.println("调用lambda表达式的匿名实现");
            return 0;
        };
        s3.add(new Student("张三",99,'母'));


        IStudent s4=(a) -> a.getAge();
        int add = s4.add(new Student("张三", 99, '母'));
        System.out.println(add);
    }
}
